function(build_dependencies)

	set(DEPENDENCIES 
		entt-3.11.1
		json-3.11.3
		zlib-1.2.13
		asio-cmake

		# mbedtls-3.5.2
		# libhv-1.3.2
		
		spdlog-1.11.0
		# SQLiteCpp-3.3.1
		concurrentqueue-1.0.4
		# lua-5.4.6
		cppcodec
		LiteNetLibCpp-0.9.5.2-asio
		Utils
		Engine
	)
	foreach(DEPENDENCY ${DEPENDENCIES})
		# Check that the libraries are present:
		if (NOT EXISTS "${PROJECT_SOURCE_DIR}/lib/${DEPENDENCY}/CMakeLists.txt")
			message(FATAL_ERROR "${DEPENDENCY} 在文件夹中丢失 lib/${DEPENDENCY}.")
		endif()
		add_subdirectory("lib/${DEPENDENCY}" EXCLUDE_FROM_ALL)
	endforeach()
endfunction()

function(link_dependencies TARGET)
	# Link dependencies as private:
	target_link_libraries(
		${TARGET} PUBLIC
		EnTT
		nlohmann_json
		zlib
		asio

		# mbedtls
		# hv

		spdlog
		# SQLiteCpp
		concurrentqueue
		cppcodec
		# lua
		LiteNetLib
		Utils
		Engine
	)
endfunction()
